CREATE TABLE ObjectType (
ObjectTypeId int NOT NULL,
ParentId int,
Name varchar(20) NOT NULL,
PRIMARY KEY (ObjectTypeId),
CONSTRAINT PARENT2 FOREIGN KEY (ParentId) REFERENCES ObjectType (ObjectTypeId) ON DELETE CASCADE
);

CREATE TABLE Attributes (
AttrId int NOT NULL,
AttrType int NOT NULL,
Name varchar(20) NOT NULL,
ObjectTypeId int NOT NULL,
PRIMARY KEY (AttrId),
CONSTRAINT ObjectTypes FOREIGN KEY (ObjectTypeId) REFERENCES ObjectType (ObjectTypeId) ON DELETE CASCADE
);

CREATE TABLE EXPREFERENCES (
  KEY VARCHAR2(50) NOT NULL,
  VALUE VARCHAR2(5),
  PRIMARY KEY (KEY)
);

CREATE TABLE Object (
ObjectId int PRIMARY KEY,
ParentId int,
Name varchar(20) NOT NULL,
ObjectTypeId int NOT NULL,
ObjectDescription varchar(2000),                   
CONSTRAINT ObjectTypes1 FOREIGN KEY (ObjectTypeId) REFERENCES ObjectType (ObjectTypeId) ON DELETE CASCADE,
CONSTRAINT Parent FOREIGN KEY (ParentId) REFERENCES Object (ObjectId) ON DELETE CASCADE
);

CREATE TABLE History (
    ObjectId int NOT NULL,
    ActionId int NOT NULL,
    Description varchar(2000),
    Datum varchar(30) NOT NULL,
    CONSTRAINT Objects2 FOREIGN KEY (ObjectId) REFERENCES Object (ObjectId) ON DELETE CASCADE 
);

CREATE TABLE Params (
ObjectId int NOT NULL,
AttrId int NOT NULL,
Value varchar(30) NOT NULL,
PRIMARY KEY (ObjectId, AttrID),
CONSTRAINT Objects FOREIGN KEY (ObjectId) REFERENCES Object (ObjectId) ON DELETE CASCADE,
CONSTRAINT Attr FOREIGN KEY (AttrId) REFERENCES Attributes (AttrId) ON DELETE CASCADE
);


CREATE TABLE Reference (
ReferenceId int NOT NULL,
ObjectId int NOT NULL,
AttrId int NOT NULL,
PRIMARY KEY (ReferenceId, ObjectId),
CONSTRAINT Objects1 FOREIGN KEY (ObjectId) REFERENCES Object (ObjectId) ON DELETE CASCADE,
CONSTRAINT Attr1 FOREIGN KEY (AttrId) REFERENCES Attributes (AttrId) ON DELETE CASCADE,
CONSTRAINT Reference1 FOREIGN KEY (ReferenceId) REFERENCES Object (ObjectId) ON DELETE CASCADE
);

CREATE SEQUENCE ObjectTypeSeq
START WITH 10
INCREMENT BY 1
NOCYCLE;


CREATE SEQUENCE AttributesSeq
START WITH 25
INCREMENT BY 1
NOCYCLE;

CREATE SEQUENCE ObjectSeq
START WITH 30
INCREMENT BY 1
NOCYCLE
NOCACHE;

CREATE OR REPLACE PROCEDURE GETNEXTSEQ
AS  
 I INT := 1;
 j INT := 1;
BEGIN
  LOOP
    SELECT last_number INTO j FROM user_sequences WHERE sequence_name = 'OBJECTSEQ';
    SELECT COUNT(ObjectId) INTO I 
    FROM OBJECT WHERE ObjectId = j;
    EXIT WHEN I = 0;
    SELECT Objectseq.NEXTVAL INTO j FROM DUAL;  
  END LOOP;
END GETNEXTSEQ;
/

INSERT INTO objecttype VALUES (1, null, 'Category');
INSERT INTO objecttype VALUES (2, null, 'Manufacture');
INSERT INTO objecttype VALUES (3, null, 'ShoppingCart');
INSERT INTO objecttype VALUES (4, 1, 'Good');
INSERT INTO Objecttype VALUES (5, null, 'Shop');

UPDATE OBJECTTYPE SET ParentId = 5
WHERE ObjectTypeId IN (1,2,3);


INSERT INTO Attributes VALUES (1, 1, 'ID', 1);
INSERT INTO Attributes VALUES (2, 2, 'Name', 1);
INSERT INTO Attributes VALUES (3, 1, 'ID', 2);
INSERT INTO Attributes VALUES (4, 2, 'Name', 2);
INSERT INTO Attributes VALUES (5, 1, 'ID', 3);
INSERT INTO Attributes VALUES (6, 1, 'ID', 4);
INSERT INTO Attributes VALUES (7, 2, 'Name', 4);
INSERT INTO Attributes VALUES (8, 2, 'Category', 4);
INSERT INTO Attributes VALUES (9, 2, 'Manufacture', 4);
INSERT INTO Attributes VALUES (10, 1, 'Price', 4);
INSERT INTO Attributes VALUES (11, 1, 'Number',4);
INSERT INTO Attributes VALUES (12, 1, 'ID', 5);
INSERT INTO Attributes VALUES (13, 2, 'Name', 5);
INSERT INTO Attributes VALUES (14, 2, 'Name', 3);
INSERT INTO Attributes VALUES (15, 3, 'CreateDate', 1);
INSERT INTO Attributes VALUES (16, 3, 'LastModifyDate', 1);
INSERT INTO Attributes VALUES (17, 3, 'CreateDate', 2);
INSERT INTO Attributes VALUES (18, 3, 'LastModifyDate', 2);
INSERT INTO Attributes VALUES (19, 3, 'CreateDate', 3);
INSERT INTO Attributes VALUES (20, 3, 'LastModifyDate', 3);
INSERT INTO Attributes VALUES (21, 3, 'CreateDate', 4);
INSERT INTO Attributes VALUES (22, 3, 'LastModifyDate', 4);
INSERT INTO Attributes VALUES (23, 3, 'CreateDate', 5);
INSERT INTO Attributes VALUES (24, 3, 'LastModifyDate', 5);

INSERT INTO EXPREFERENCES VALUES ('searchByReference', 'true');

INSERT INTO Object VALUES (1, null, 'Irons', 1, 'irons');
INSERT INTO Object VALUES (2, null, 'Kettles', 1, 'Kettles');
INSERT INTO Object VALUES (3, null, 'Vac', 1, 'vac');
INSERT INTO Object VALUES (4, null, 'Bosh', 2, 'bosh');
INSERT INTO Object VALUES (5, null, 'Samsung', 2, 'Samsung');
INSERT INTO Object VALUES (6, null, 'Electrolux', 2, 'Electrolux');
INSERT INTO Object VALUES (7, 1, 'I1', 4, 'description11');
INSERT INTO Object VALUES (8, 1, 'I2', 4, 'description12');
INSERT INTO Object VALUES (9, 1, 'I3', 4, 'description13');
INSERT INTO Object VALUES (10, 1, 'I4', 4, 'description14');
INSERT INTO Object VALUES (11, 1, 'I5', 4, 'description15');
INSERT INTO Object VALUES (12, 1, 'I6', 4, 'description16');
INSERT INTO Object VALUES (13, 2, 'K1', 4, 'description21');
INSERT INTO Object VALUES (14, 2, 'K2', 4, 'description22');
INSERT INTO Object VALUES (15, 2, 'K3', 4, 'description23');
INSERT INTO Object VALUES (16, 2, 'K4', 4, 'description24');
INSERT INTO Object VALUES (17, 2, 'K5', 4, 'description25');
INSERT INTO Object VALUES (18, 2, 'K6', 4, 'description26');
INSERT INTO Object VALUES (19, 3, 'V1', 4, 'description31');
INSERT INTO Object VALUES (20, 3, 'V2', 4, 'description32');
INSERT INTO Object VALUES (21, 3, 'V3', 4, 'description33');
INSERT INTO Object VALUES (22, 3, 'V4', 4, 'description34');
INSERT INTO Object VALUES (23, 3, 'V5', 4, 'description35');
INSERT INTO Object VALUES (24, 3, 'V6', 4, 'description36');
INSERT INTO Object VALUES (25, null, 'ShoppingCart',3, 'ShoppingCart');
INSERT INTO Object VALUES (26, null, 'Shop1',5, 'Shop1');

INSERT INTO History VALUES (26, 1, 'Id = 26, parentId = null, name = Shop1.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (25, 1, 'Id = 25, parentId = 26, name = ShoppingCart', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (1, 1, 'Id = 1, parentId = 26, name = Irons.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 1, 'Id = 2, parentId = 26, name = Kettles.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 1, 'Id = 3, parentId = 26, name = Vac.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (4, 1, 'Id = 4, parentId = 26, name = Bosh.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (5, 1, 'Id = 5, parentId = 26, name = Samsung.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (6, 1, 'Id = 6, parentId = 26, name = Electrolux.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (7, 1, 'Id = 7, parentId = 1, name = I1, manufacturerId = 4, price = 100, number = 10.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (8, 1, 'Id = 8, parentId = 1, name = I2, manufacturerId = 5, price = 200, number = 20.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (9, 1, 'Id = 9, parentId = 1, name = I3, manufacturerId = 4, price = 300, number = 3.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (10, 1, 'Id = 10, parentId = 1, name = I4, manufacturerId = 6, price = 400, number = 7.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (11, 1, 'Id = 11, parentId = 1, name = I5, manufacturerId = 6, price = 500, number = 6.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (12, 1, 'Id = 12, parentId = 1, name = I6, manufacturerId = 5, price = 600, number = 6.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (13, 1, 'Id = 13, parentId = 2, name = K1, manufacturerId = 6, price = 100, number = 15.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (14, 1, 'Id = 14, parentId = 2, name = K2, manufacturerId = 5, price = 200, number = 24.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (15, 1, 'Id = 15, parentId = 2, name = K3, manufacturerId = 4, price = 300, number = 65.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (16, 1, 'Id = 16, parentId = 2, name = K4, manufacturerId = 4, price = 400, number = 78.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (17, 1, 'Id = 17, parentId = 2, name = K5, manufacturerId = 5, price = 500, number = 3.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (18, 1, 'Id = 18, parentId = 2, name = K6, manufacturerId = 6, price = 600, number = 8.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (19, 1, 'Id = 19, parentId = 3, name = V1, manufacturerId = 4, price = 700, number = 6.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (20, 1, 'Id = 20, parentId = 3, name = V2, manufacturerId = 6, price = 200, number = 45.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (21, 1, 'Id = 21, parentId = 3, name = V3, manufacturerId = 5, price = 300, number = 32.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (22, 1, 'Id = 22, parentId = 3, name = V4, manufacturerId = 5, price = 400, number = 24.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (23, 1, 'Id = 23, parentId = 3, name = V5, manufacturerId = 4, price = 500, number = 45.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (24, 1, 'Id = 24, parentId = 3, name = V6, manufacturerId = 6, price = 600, number = 44.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));

INSERT INTO History VALUES (26, 3, 'Child was created with id = 1.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (26, 3, 'Child was created with id = 2.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (26, 3, 'Child was created with id = 3.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (26, 3, 'Child was created with id = 4.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (26, 3, 'Child was created with id = 5.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (26, 3, 'Child was created with id = 6.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));

INSERT INTO History VALUES (1, 3, 'Child was created with id = 7.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (1, 3, 'Child was created with id = 8.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (1, 3, 'Child was created with id = 9.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (1, 3, 'Child was created with id = 10.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (1, 3, 'Child was created with id = 11.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (1, 3, 'Child was created with id = 12.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 3, 'Child was created with id = 13.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 3, 'Child was created with id = 14.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 3, 'Child was created with id = 15.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 3, 'Child was created with id = 16.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 3, 'Child was created with id = 17.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (2, 3, 'Child was created with id = 18.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 3, 'Child was created with id = 19.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 3, 'Child was created with id = 20.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 3, 'Child was created with id = 21.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 3, 'Child was created with id = 22.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 3, 'Child was created with id = 23.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO History VALUES (3, 3, 'Child was created with id = 24.', TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));

UPDATE Object SET ParentId = 26
WHERE ObjectId IN (1,2,3,4,5,6,25);

INSERT INTO Params VALUES (7, 10, '100');
INSERT INTO Params VALUES (8, 10, '200');
INSERT INTO Params VALUES (9, 10, '300');
INSERT INTO Params VALUES (10, 10, '400');
INSERT INTO Params VALUES (11, 10, '500');
INSERT INTO Params VALUES (12, 10, '600');
INSERT INTO Params VALUES (13, 10, '100');
INSERT INTO Params VALUES (14, 10, '200');
INSERT INTO Params VALUES (15, 10, '300');
INSERT INTO Params VALUES (16, 10, '400');
INSERT INTO Params VALUES (17, 10, '500');
INSERT INTO Params VALUES (18, 10, '600');
INSERT INTO Params VALUES (19, 10, '700');
INSERT INTO Params VALUES (20, 10, '200');
INSERT INTO Params VALUES (21, 10, '300');
INSERT INTO Params VALUES (22, 10, '400');
INSERT INTO Params VALUES (23, 10, '500');
INSERT INTO Params VALUES (24, 10, '600');

INSERT INTO Params VALUES (7, 11, '10');
INSERT INTO Params VALUES (8, 11, '20');
INSERT INTO Params VALUES (9, 11, '3');
INSERT INTO Params VALUES (10, 11, '7');
INSERT INTO Params VALUES (11, 11, '6');
INSERT INTO Params VALUES (12, 11, '6');
INSERT INTO Params VALUES (13, 11, '15');
INSERT INTO Params VALUES (14, 11, '24');
INSERT INTO Params VALUES (15, 11, '65');
INSERT INTO Params VALUES (16, 11, '78');
INSERT INTO Params VALUES (17, 11, '3');
INSERT INTO Params VALUES (18, 11, '8');
INSERT INTO Params VALUES (19, 11, '6');
INSERT INTO Params VALUES (20, 11, '45');
INSERT INTO Params VALUES (21, 11, '32');
INSERT INTO Params VALUES (22, 11, '24');
INSERT INTO Params VALUES (23, 11, '45');
INSERT INTO Params VALUES (24, 11, '44');

INSERT INTO Params VALUES (1, 15, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (2, 15, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (3, 15, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (4, 17, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (5, 17, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (6, 17, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (7, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (8, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (9, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (10, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (11, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (12, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (13, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (14, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (15, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (16, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (17, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (18, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (19, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (20, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (21, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (22, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (23, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (24, 21, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (25, 19, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (26, 23, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));

INSERT INTO Params VALUES (1, 16, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (2, 16, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (3, 16, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (4, 18, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (5, 18, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (6, 18, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (7, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (8, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (9, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (10, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (11, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (12, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (13, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (14, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (15, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (16, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (17, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (18, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (19, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (20, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (21, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (22, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (23, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (24, 22, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (25, 20, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));
INSERT INTO Params VALUES (26, 24, TO_CHAR(SYSDATE,'DD.MM.YYYY HH24:MI:SS'));


INSERT INTO Reference VALUES (4, 7, 9);
INSERT INTO Reference VALUES (5, 8, 9);
INSERT INTO Reference VALUES (4, 9, 9);
INSERT INTO Reference VALUES (6, 10, 9);
INSERT INTO Reference VALUES (6, 11, 9);
INSERT INTO Reference VALUES (5, 12, 9);
INSERT INTO Reference VALUES (6, 13, 9);
INSERT INTO Reference VALUES (5, 14, 9);
INSERT INTO Reference VALUES (4, 15, 9);
INSERT INTO Reference VALUES (4, 16, 9);
INSERT INTO Reference VALUES (5, 17, 9);
INSERT INTO Reference VALUES (6, 18, 9);
INSERT INTO Reference VALUES (4, 19, 9);
INSERT INTO Reference VALUES (6, 20, 9);
INSERT INTO Reference VALUES (5, 21, 9);
INSERT INTO Reference VALUES (5, 22, 9);
INSERT INTO Reference VALUES (4, 23, 9);
INSERT INTO Reference VALUES (6, 24, 9);